-
Notifications
You must be signed in to change notification settings - Fork 6.4k
[feat] allow sparsectrl to be loaded from single file #9073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@DN6 I currently get the following error when trying to load with single file: Logs
This works when accelerate isn't installed but fails if it is. Not really too sure on how this can be fixed so would appreciate any advice @DN6 |
"stable_cascade_stage_c": "clip_txt_mapper.weight", | ||
"sd3": "model.diffusion_model.joint_blocks.0.context_block.adaLN_modulation.1.bias", | ||
"animatediff": "down_blocks.0.motion_modules.0.temporal_transformer.transformer_blocks.0.attention_blocks.1.pos_encoder.pe", | ||
"animatediff": "down_blocks.0.motion_modules.0.temporal_transformer.transformer_blocks.0.attention_blocks.0.pos_encoder.pe", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to 0 because it still identifies animatediff, I think, and since SparseCtrl does not have 1
@a-r-r-o-w You have required keys missing from the checkpoint. Accelerate loads the weights initially as meta tensors. The ones that don't have a corresponding weight in the checkpoint remain meta tensors and cannot be moved to device. When you load directly with torch, those weights just stay as random tensors. Is the checkpoint conversion function for SparseCntrl the same as the one for the Motion Adapter? Here are the missing keys 👇🏽
Looks like the downblock weights are being missed? |
Hmm, interesting. The conversion script mapping dict is pretty much the same as that of animatediff (and you can see I've done a strict match in conversion script)
I'll take a look again |
I think |
Oh... Really sorry for the oversight - I did not realize it was needed and had something else in mind when I removed it. I just tested the latest changes and can verify it works as expected, thanks! |
* allow sparsectrl to be loaded with single file * update --------- Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
What does this PR do?
Adds support for SparseCtrl to be loaded with single file.
Code
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@DN6